import itstgcnEvolveGCNH
import torch
import itstgcnEvolveGCNH.planner
import pandas as pd
import numpy as np
import random
ITSTGCN add Model
ITSTGCN
summerizing it
RANDOM
예
= itstgcnGCLSTM.load_data('./data/fivenodes.pkl')
data_dict = itstgcnGConvLSTM.DatasetLoader(data_dict) loader
from torch_geometric_temporal.dataset import ChickenpoxDatasetLoader
= ChickenpoxDatasetLoader() loader1
from torch_geometric_temporal.dataset import PedalMeDatasetLoader
= PedalMeDatasetLoader() loader2
from torch_geometric_temporal.dataset import WikiMathsDatasetLoader
= WikiMathsDatasetLoader() loader3
# from torch_geometric_temporal.dataset import WindmillOutputLargeDatasetLoader
# loader4 = WindmillOutputLargeDatasetLoader()
# from torch_geometric_temporal.dataset import WindmillOutputMediumDatasetLoader
# loader5 = WindmillOutputMediumDatasetLoader()
# from torch_geometric_temporal.dataset import WindmillOutputSmallDatasetLoader
# loader6 = WindmillOutputSmallDatasetLoader()
= itstgcnEvolveGCNH.load_data('./data/Windmillsmall.pkl') loader6
# dataset6 = _a.get_dataset(lags=8)
from torch_geometric_temporal.dataset import MontevideoBusDatasetLoader
= MontevideoBusDatasetLoader() loader10
Simulation
= {
plans_stgcn_rand 'max_iteration': 1,
'method': ['STGCN', 'IT-STGCN'],
'mrate': [0.7],
'lags': [8],
'nof_filters': [12],
'inter_method': ['linear'],
'epoch': [50]
}
= itstgcnEvolveGCNH.planner.PLNR_STGCN_RAND(plans_stgcn_rand,loader6,dataset_name='windmillsmall')
plnr plnr.simulate()
= {
plans_stgcn_rand 'max_iteration': 15,
'method': ['STGCN', 'IT-STGCN'],
'mrate': [0.7],
'lags': [2],
'nof_filters': [12],
'inter_method': ['linear','nearest'],
'epoch': [50]
}
= itstgcnGConvLSTM.planner.PLNR_STGCN_RAND(plans_stgcn_rand,loader,dataset_name='fivenodes')
plnr
plnr.simulate()
= {
plans_stgcn_rand 'max_iteration': 15,
'method': ['STGCN', 'IT-STGCN'],
'mrate': [0.8],
'lags': [2],
'nof_filters': [12],
'inter_method': ['linear','nearest'],
'epoch': [50]
}
= itstgcnGConvLSTM.planner.PLNR_STGCN_RAND(plans_stgcn_rand,loader,dataset_name='fivenodes')
plnr
plnr.simulate()
= {
plans_stgcn_rand 'max_iteration': 15,
'method': ['STGCN', 'IT-STGCN'],
'mrate': [0],
'lags': [2],
'nof_filters': [12],
'inter_method': ['linear','nearest'],
'epoch': [50]
}
= itstgcnGConvLSTM.planner.PLNR_STGCN_RAND(plans_stgcn_rand,loader,dataset_name='fivenodes')
plnr
plnr.simulate()
= [[],[],[],list(range(50,150)),[]]
mindex# mindex= [list(range(50,150)),[],list(range(50,90)),list(range(50,150)),[]] # node 2
= {
plans_stgcn_block 'max_iteration': 15,
'method': ['STGCN', 'IT-STGCN'],
'mindex': [mindex],
'lags': [2],
'nof_filters': [12],
'inter_method': ['linear','nearest'],
'epoch': [50]
}
= itstgcnGConvLSTM.planner.PLNR_STGCN_MANUAL(plans_stgcn_block,loader,dataset_name='fivenodes')
plnr
=mindex,mtype='block') plnr.simulate(mindex
= {
plans_stgcn_rand 'max_iteration': 15,
'method': ['STGCN', 'IT-STGCN'],
'mrate': [0.3,0.8],
'lags': [4],
'nof_filters': [32],
'inter_method': ['linear'],
'epoch': [50]
}
= itstgcnGConvLSTM.planner.PLNR_STGCN_RAND(plans_stgcn_rand,loader1,dataset_name='chickenpox')
plnr plnr.simulate()
= {
plans_stgcn_rand 'max_iteration': 15,
'method': ['STGCN', 'IT-STGCN'],
'mrate': [0],
'lags': [4],
'nof_filters': [32],
'inter_method': ['linear'],
'epoch': [50]
}
= itstgcnGConvLSTM.planner.PLNR_STGCN_RAND(plans_stgcn_rand,loader1,dataset_name='chickenpox')
plnr plnr.simulate()
= [[] for _ in range(20)] #chickenpox
my_list = list(range(100,400))
another_list 1] = another_list
my_list[3] = another_list
my_list[5] = another_list
my_list[7] = another_list
my_list[9] = another_list
my_list[11] = another_list
my_list[13] = another_list
my_list[15] = another_list
my_list[= my_list mindex
# mindex= [[],[],[],list(range(50,150)),[]]
# mindex= [list(range(50,150)),[],list(range(50,90)),list(range(50,150)),[]] # node 2
= {
plans_stgcn_block 'max_iteration': 15,
'method': ['STGCN', 'IT-STGCN'],
'mindex': [mindex],
'lags': [4],
'nof_filters': [32],
'inter_method': ['linear','nearest'],
'epoch': [50]
}
= itstgcnGConvLSTM.planner.PLNR_STGCN_MANUAL(plans_stgcn_block,loader1,dataset_name='chickenpox')
plnr
=mindex,mtype='block') plnr.simulate(mindex
= {
plans_stgcn_rand 'max_iteration': 30,
'method': ['STGCN', 'IT-STGCN'],
'mrate': [0,0.3,0.6],
'lags': [4],
'nof_filters': [2],
'inter_method': ['linear','nearest'],
'epoch': [50]
}
= itstgcnGConvLSTM.planner.PLNR_STGCN_RAND(plans_stgcn_rand,loader2,dataset_name='pedalme')
plnr
plnr.simulate()
= [[] for _ in range(15)] #pedalme
my_list = list(range(5,25))
another_list 1] = another_list
my_list[3] = another_list
my_list[5] = another_list
my_list[7] = another_list
my_list[9] = another_list
my_list[11] = another_list
my_list[= my_list mindex
# mindex= [[],[],[],list(range(50,150)),[]] # node 1
# mindex= [list(range(10,100)),[],list(range(50,80)),[],[]] # node 2
# mindex= [list(range(10,100)),[],list(range(50,80)),list(range(50,150)),[]] # node3
= {
plans_stgcn_block 'max_iteration': 30,
'method': ['STGCN', 'IT-STGCN'],
'mindex': [mindex],
'lags': [4],
'nof_filters': [2],
'inter_method': ['linear','nearest'],
'epoch': [50]
}
= itstgcnGConvLSTM.planner.PLNR_STGCN_MANUAL(plans_stgcn_block,loader2,dataset_name='pedalme')
plnr =mindex,mtype='block') plnr.simulate(mindex
= {
plans_stgcn_rand 'max_iteration': 10,
'method': ['STGCN', 'IT-STGCN'],
'mrate': [0.3],
'lags': [8],
'nof_filters': [12],
'inter_method': ['linear'],
'epoch': [50]
}
= itstgcnEvolveGCNH.planner.PLNR_STGCN_RAND(plans_stgcn_rand,loader3,dataset_name='wikimath')
plnr plnr.simulate()
= {
plans_stgcn_rand 'max_iteration': 15,
'method': ['STGCN', 'IT-STGCN'],
'mrate': [0.8],
'lags': [8],
'nof_filters': [12],
'inter_method': ['linear'],
'epoch': [50]
}
= itstgcnEvolveGCNH.planner.PLNR_STGCN_RAND(plans_stgcn_rand,loader3,dataset_name='wikimath')
plnr plnr.simulate()
= {
plans_stgcn_rand 'max_iteration': 10,
'method': ['STGCN', 'IT-STGCN'],
'mrate': [0],
'lags': [8],
'nof_filters': [12],
'inter_method': ['linear'],
'epoch': [50]
}
= itstgcnEvolveGCNH.planner.PLNR_STGCN_RAND(plans_stgcn_rand,loader3,dataset_name='wikimath')
plnr plnr.simulate()
import random
= [[] for _ in range(1068)] # wikimath
my_list = random.sample(range(570), 72)
another_list # my_list에서 250개 요소 무작위 선택
= random.sample(range(len(my_list)), 250)
selected_indexes # 선택된 요소에 해당하는 값들을 another_list에 할당
for index in selected_indexes:
= another_list my_list[index]
import random
= [[] for _ in range(1068)] # wikimath
my_list = random.sample(range(570), 150)
another_list # my_list에서 250개 요소 무작위 선택
= random.sample(range(len(my_list)), 500)
selected_indexes # 선택된 요소에 해당하는 값들을 another_list에 할당
for index in selected_indexes:
= another_list
my_list[index] = my_list mindex
# mindex= [[],[],[],list(range(50,150)),[]] # node 1
# mindex= [list(range(10,100)),[],list(range(50,80)),[],[]] # node 2
# mindex= [list(range(10,100)),[],list(range(50,80)),list(range(50,150)),[]] # node3
= {
plans_stgcn_block 'max_iteration': 10,
'method': ['STGCN', 'IT-STGCN'],
'mindex': [mindex],
'lags': [8],
'nof_filters': [12],
'inter_method': ['linear'],
'epoch': [50]
}
= itstgcnEvolveGCNH.planner.PLNR_STGCN_MANUAL(plans_stgcn_block,loader3,dataset_name='wikimath')
plnr =mindex,mtype='block') plnr.simulate(mindex
같은 노드 같은 missing
= [[] for _ in range(1068)] #wikimath
my_list = random.sample(range(0, 576), 300)
another_list for i in range(0, 1068):
= another_list
my_list[i] = my_list mindex
= {
plans_stgcn_block 'max_iteration': 10,
'method': ['STGCN', 'IT-STGCN'],
'mindex': [mindex],
'lags': [8],
'nof_filters': [12],
'inter_method': ['linear'],
'epoch': [50]
}
= itstgcnEvolveGCNH.planner.PLNR_STGCN_MANUAL(plans_stgcn_block,loader3,dataset_name='wikimath')
plnr =mindex,mtype='block') plnr.simulate(mindex
= {
plans_stgcn_rand 'max_iteration': 15,
'method': ['STGCN', 'IT-STGCN'],
'mrate': [0.8],
'lags': [4],
'nof_filters': [12],
'inter_method': ['nearest'],
'epoch': [50]
}
= itstgcnGConvLSTM.planner.PLNR_STGCN_RAND(plans_stgcn_rand,loader10,dataset_name='monte')
plnr plnr.simulate()
= {
plans_stgcn_rand 'max_iteration': 15,
'method': ['STGCN', 'IT-STGCN'],
'mrate': [0],
'lags': [4],
'nof_filters': [12],
'inter_method': ['nearest'],
'epoch': [50]
}
= itstgcnGConvLSTM.planner.PLNR_STGCN_RAND(plans_stgcn_rand,loader10,dataset_name='monte')
plnr plnr.simulate()
= [[] for _ in range(675)] #monte
my_list = list(range(200,350)) #743
another_list
for i in np.array(random.sample(range(0, 675), 400)):
= another_list
my_list[i] = my_list mindex
# mindex= [[],[],[],list(range(50,150)),[]] # node 1
# mindex= [list(range(10,100)),[],list(range(50,80)),[],[]] # node 2
# mindex= [list(range(10,100)),[],list(range(50,80)),list(range(50,150)),[]] # node3
= {
plans_stgcn_block 'max_iteration': 15,
'method': ['STGCN', 'IT-STGCN'],
'mindex': [mindex],
'lags': [4],
'nof_filters': [12],
'inter_method': ['nearest'],
'epoch': [50]
}
= itstgcnGConvLSTM.planner.PLNR_STGCN_MANUAL(plans_stgcn_block,loader10,dataset_name='monte')
plnr =mindex,mtype='block') plnr.simulate(mindex
= itstgcnGConvLSTM.planner.PLNR_STGCN_MANUAL(plans_stgcn_block,loader10,dataset_name='monte')
plnr =mindex,mtype='block') plnr.simulate(mindex